//
//  BeanGunReticle.m
//  RtspClient
//
//  Created by qi tan on 2024/1/10.
//  Copyright © 2024 Andres Rojas. All rights reserved.
//

#import "BeanGunReticle.h"

@implementation BeanGunReticle

- (instancetype)initWithDict:(NSDictionary *)dict {
    if(self = [super init]) {
        if([[dict allKeys] containsObject:@"gunIdx"]) {
            self.gunIdx = dict[@"gunIdx"] ;
        }
        if([[dict allKeys] containsObject:@"centerOffsetX"]) {
            self.centerOffsetX = dict[@"centerOffsetX"] ;
        }
        if([[dict allKeys] containsObject:@"centerOffsetY"]) {
            self.centerOffsetY = dict[@"centerOffsetY"] ;
        }
        if([[dict allKeys] containsObject:@"mode"]) {
            self.mode = dict[@"mode"] ;
        }
        if([[dict allKeys] containsObject:@"color"]) {
            self.color = dict[@"color"] ;
        }
    }
    return self;
}

+ (instancetype)beanWithDict:(NSDictionary *)dict {
    return [[self alloc]initWithDict:dict];
}

- (NSString *)description {
    return [NSString stringWithFormat:@"BeanGunReticle-: gunIdx:%@, mode:%@, color:%@",
            self.gunIdx, self.mode, self.color];
}

@end
